package com.sf.fy.uav.order.controller;


import com.sf.fy.uav.common.request.operate.ErrandOrderReq;
import com.sf.fy.uav.common.response.order.ErrandOrderResp;
import com.sf.fy.uav.common.response.order.ErrandOrderStatusResp;
import com.sf.fy.uav.common.utils.RespJsonPageData;
import com.sf.fy.uav.common.utils.Rs;
import com.sf.fy.uav.entity.ErrandOrder;
import com.sf.fy.uav.service.IErrandOrderService;
import com.sf.fy.uav.task.service.ITaskStatusLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sys/orderInfo")
@RequiredArgsConstructor
public class ErrandOrderRest {

    private final IErrandOrderService iErrandOrderService;
    private final ITaskStatusLogService iTaskStatusLogService;

    public RespJsonPageData<ErrandOrderResp> getErrandOrderList(ErrandOrderReq errandOrderReq) {
        return iErrandOrderService.getErrandOrderList(errandOrderReq);
    }

    public Rs<ErrandOrderStatusResp> getStatusLogList(ErrandOrderReq errandOrderReq) {
        return iTaskStatusLogService.getStatusLogList(errandOrderReq);
    }

    public ErrandOrder getByErrandOrderSn(String errandOrderSn) {
        return iErrandOrderService.getByErrandOrderSn(errandOrderSn);
    }

    public Rs<String> getDecodePhone(String id) {
        return iErrandOrderService.getDecodePhoneById(id);
    }
}
